package com.cloud.mq.modo;

import cn.hutool.core.date.DateUtil;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
@Builder
public class MsgDto implements Serializable {
    private String uuid;
    private String publicTime;
    private String msgContent;
    public static MsgDto buildDto(String uuid,
                                  long publicTime,
                                  String msgContent) {
        return builder().uuid(uuid)
                .publicTime(DateUtil.formatDateTime(new Date(publicTime)))
                .msgContent(msgContent).build();
    }
}